using System;
using System.Text.RegularExpressions;

namespace SqlCeDriver
{
	/// <summary>
	/// Summary description for SimpleRegex.
	/// </summary>
	public class SimpleRegex : System.Text.RegularExpressions.Regex
	{
		Match currentMatch;

		public SimpleRegex(String source)
			: base(source)
		{
		}

		public String this[int index]
		{
			get
			{
				return currentMatch.Groups[index].Value;
			}
		}

		public bool MatchText(String target)
		{
			this.currentMatch = this.Match(target);
			// if match
			return this.currentMatch.Success;
		}
	}
}
